// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 上传文件 POST /api/file/upload */
export async function uploadFileUsingPost(
  params: {
    file: File
    fileSize: number
    fileName: string
    fileMd5: string
    chunkIndex: number
    chunks: number
    filePid?: string
    fileId?: string
  },
  options?: { [key: string]: any }
) {
  const formData = new FormData()
  formData.append('file', params.file)
  formData.append('fileSize', params.fileSize.toString())
  formData.append('fileName', params.fileName)
  formData.append('fileMd5', params.fileMd5)
  formData.append('chunkIndex', params.chunkIndex.toString())
  formData.append('chunks', params.chunks.toString())
  if (params.filePid) {
    formData.append('filePid', params.filePid)
  }
  if (params.fileId) {
    formData.append('fileId', params.fileId)
  }

  return request<API.Result>('/api/fileInfo/uploadFile', {
    method: 'POST',
    data: formData,
    requestType: 'form',
    ...(options || {}),
  })
}

/** 根据条件文件分页查询 GET /api/fileInfo/loadDataList */
export async function getFileListUsingGet(
  params: API.FileQueryDTO,
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/loadDataList', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 查看文件 GET /api/fileInfo/getFile/${param0} */
export async function getFileUsingGet(
  params: {
    /** fileId */
    fileId: string
  },
  options?: { [key: string]: any }
) {
  const { fileId: param0, ...queryParams } = params
  return request<API.Result>(`/api/fileInfo/getFile/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 删除文件 POST /api/fileInfo/delFile */
export async function deleteFileUsingPost(
  params: {
    /** fileIds */
    fileIds: string[]
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/delFile', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 重命名文件 POST /api/fileInfo/rename */
export async function renameFileUsingPost(
  body: API.RenameFileDTO,
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/rename', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 创建文件下载路径 POST /api/fileInfo/createDownloadUrl/${param0} */
export async function createDownloadUrlUsingPost(
  params: {
    /** fileId */
    fileId: string
  },
  options?: { [key: string]: any }
) {
  const { fileId: param0, ...queryParams } = params
  return request<API.Result>(`/api/fileInfo/createDownloadUrl/${param0}`, {
    method: 'POST',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 获取文件下载路径 GET /api/fileInfo/download/${param0} */
export async function downloadFileUsingGet(
  params: {
    /** code */
    code: string
  },
  options?: { [key: string]: any }
) {
  const { code: param0, ...queryParams } = params
  return request<API.Result>(`/api/fileInfo/download/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 创建文件夹 POST /api/fileInfo/newFoloder */
export async function createFolderUsingPost(
  params: {
    /** filePid */
    filePid: string
    /** fileName */
    fileName: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/newFoloder', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 获取文件夹信息 POST /api/fileInfo/getFolderInfo */
export async function getFolderInfoUsingPost(
  params: {
    /** path */
    path: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/getFolderInfo', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 获取文件夹 POST /api/fileInfo/loadAllFolder */
export async function loadAllFolderUsingPost(
  params: {
    /** filePid */
    filePid: string
    /** currentFileIds */
    currentFileIds: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/loadAllFolder', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 移动文件 POST /api/fileInfo/changeFileFolder */
export async function changeFileFolderUsingPost(
  params: {
    /** fileIds */
    fileIds: string
    /** filePid */
    filePid: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/changeFileFolder', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 获取文件统计信息 POST /api/fileInfo/statistics */
export async function getFileStatisticsUsingPost(options?: { [key: string]: any }) {
  return request<API.Result>('/api/fileInfo/statistics', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 获取文件类型分布 POST /api/fileInfo/typeDistribution */
export async function getFileTypeDistributionUsingPost(options?: { [key: string]: any }) {
  return request<API.Result>('/api/fileInfo/typeDistribution', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 获取回收站列表 分页获取回收站文件列表 POST /api/file/loadRecycleList */
export async function loadRecycleListUsingPost(
  params: {
    /** 页码 */
    pageNo: number
    /** 每页数量 */
    pageSize: number
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/loadRecycleList', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 恢复文件 从回收站恢复文件 POST /api/file/recoverFile */
export async function recoverFileUsingPost(
  params: {
    /** 文件ID列表，多个ID用逗号分隔 */
    fileIds: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/recoverFile', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 永久删除回收站文件 POST /api/file/delRecycleFile */
export async function delRecycleFileUsingPost(
  params: {
    /** 文件ID列表，多个ID用逗号分隔 */
    fileIds: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/delRecycleFile', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 获取文件内容 GET /api/fileInfo/getContent */
export async function getFileContentUsingGet(
  params: {
    /** fileId */
    fileId: string
  },
  options?: { [key: string]: any }
) {
  return request<API.Result>('/api/fileInfo/getContent', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}
